package simpleGui;

import java.io.File;
import java.io.FilenameFilter;
import java.util.Vector;

public class FileHelper {
	public static Vector<File> getFilesFromFolder(String folderPath,String ending) {
		File dir = new File(folderPath);
		FilenameFilter filter = new FilenameFilter() {
			public boolean accept(File dir, String name) {
				boolean acc=true;
				if (name.startsWith("."))return false;
				return !name.startsWith(".");
			}
		};
		String[] children  = dir.list(filter);
		File[] files = dir.listFiles();
		Vector<File>cFiles=new Vector<File>();
		for (int i=0;i<files.length;i++){
			File file=files[i];
			if (file.getAbsolutePath().endsWith(ending)){
				cFiles.add(file);
			}
		}
		return cFiles;

	}
}
